package org.geektimes.gitee.oauth.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class APILoginControoler {
	
	private final static Logger LOG = LoggerFactory.getLogger(APILoginControoler.class);
	@GetMapping("/login")
    public String index(){
        return "index.jsp";
    }
	
	@GetMapping("/oauth/redirect")
	@ResponseBody
	public String oauthRedirect(@RequestParam(value = "code") String code){
		
		LOG.info("回调返回的code为:  " + code);
		return "OK";
	}
	
}
